package com.yigerende.service.impl;

import com.yigerende.dao.OrderDao;
import com.yigerende.pojo.TOrder;
import com.yigerende.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public int save(TOrder order) {
        return orderDao.save(order);
    }

    @Override
    public List<TOrder> findAllByUid(Map<String, Integer> map) {
        return orderDao.findAllByUid(map);
    }

    @Override
    public int countByUid(Integer uid) {
        return orderDao.countByUid(uid);
    }

    @Override
    public int deleteByMid(Integer mid) {
        return orderDao.deleteByMid(mid);
    }

    @Override
    public int deleteByUid(Integer uid) {
        return orderDao.deleteByUid(uid);
    }

    @Override
    public List<TOrder> findAllByState(Map<String, Integer> map) {
        return orderDao.findAllByState(map);
    }

    @Override
    public int countByState(Integer state) {
        return orderDao.countByState(state);
    }

    @Override
    public int updateState(Integer id, Integer aid, Integer state) {
        return orderDao.updateState(id,aid,state);
    }
}
